package com.aos.erp.manager.model.review.vo;

import com.aos.erp.manager.enums.review.ExportFileType;
import com.aos.erp.manager.enums.review.ImportExportType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@Data
@ApiModel("导入导出记录查询条件")
public class ReviewConditionVo implements Serializable {

    @ApiModelProperty(hidden = true, value = "每页查询数量")
    private int pageSize = 20;
    @ApiModelProperty(hidden = true, value = "当前页码")
    private int pageIndex = 1;
    @ApiModelProperty(hidden = true, value = "流水号")
    private String serialNumber="";
    @ApiModelProperty(hidden = true, value = "操作省Code")
    private String provinceCode="";
    @ApiModelProperty(hidden = true, value = "操作城市Code")
    private String cityCode="";
    @ApiModelProperty(hidden = true, value = "时间类型：1为申请时间；2为受理时间")
    private int timeType = 0;
    @ApiModelProperty(hidden = true, value = "开始时间")
    private String fromTime="";
    @ApiModelProperty(hidden = true, value = "结束时间")
    private String toTime="";

    @ApiModelProperty(hidden = true, value = "学员姓名或证件号码")
    private String searchKey="";
    @ApiModelProperty(hidden = true, value = "记录Id")
    private long recordId = 0;
    @ApiModelProperty(hidden = true, value = "文件类别")
    private ExportFileType fileType=ExportFileType.all;
    @ApiModelProperty(hidden = true, value = "文件类别值")
    private int fileTypeValue;
    @ApiModelProperty(hidden = true, value = "导入导出状态")
    private ImportExportType exportStatus = ImportExportType.all;
    @ApiModelProperty(hidden = true, value = "导入导出状态值")
    private int exportStatusValue;

    public int getFileTypeValue() {
        return (int)fileType.getValue();
    }

    public int getExportStatusValue() {
        return (int)exportStatus.getValue();
    }

    public String getFromTime() {
        if(fromTime.length() > 0 && fromTime.length() == 10) {
            fromTime = fromTime + " 00:00:00";
        }
        return fromTime;
    }

    public String getToTime() {
        if(toTime.length() > 0 && toTime.length() == 10) {
            toTime = toTime + " 23:59:59";
        }
        return toTime;
    }
}
